async function fetchDataFromApi() {
    try {
      const res = await fetch('https://v2.jokeapi.dev/joke/Programming?type=single');
      const json = await res.json();
      console.log(json.joke);
    } catch (error) {
      // Handle the error here in whichever way you like
      console.log('Something went wrong!');
      console.warn(error)
    }
  }
  
  await fetchDataFromApi();
  console.log('Finished fetching data');